<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
	        <li class="active"><a href="#A" data-toggle="tab">{:L('GENERAL_SETTING')}</a></li>
	        <li><a href="#B" data-toggle="tab">{:L('SEO_SETTING')}</a></li>
	        <li><a href="#C" data-toggle="tab">{:L('TEMPLATE_SETTING')}</a></li>
	    </ul>
		<form class="form-horizontal js-ajax-form" action="{:U('AdminEMallTerm/add_post')}" method="post">
			<div class="tabbable">
		        <div class="tab-content">
		          <div class="tab-pane active" id="A">
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('PARENT')}</label>
								<div class="controls">
									<select name="parent">
										<option value="0">{:L('ROOT')}</option>
										{$terms_tree}
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('NAME')}</label>
								<div class="controls">
									<input type="text" name="name" value=""><span class="form-required">*</span>
								</div>
							</div>
							<php>
								$display=$parent>0 ? '' : 'style="display:none"';
							</php>
							<div class="control-group">
								<label class="control-label">{:L('DISPLAY')}</label>
								<div class="controls">
									<select name="status">
										<option value="1">是</option>
										<option value="0">否</option>
									</select>
								</div>
							</div>
							<div class="control-group extraForm" {$display}>
								<label class="control-label">{:L('BIND_PROPERTY')}</label>
								<div class="controls">
									<select name="property_id" id="bindProperty">
									<option value="0">请选择商品属性</option>
										{$propertyOption}
									</select>
								</div>
							</div>							
							<div class="control-group extraForm" {$display}>
								<label class="control-label">{:L('PRICE_FILTER_LOW')}</label>
								<div class="controls">
									<input type="text" name="price_low" value="" placeholder="请填写价格区间如：120-360">
									<span>每组价格请用 | 隔开</span>
								</div>
							</div>
							<div class="control-group extraForm" {$display}>
								<label class="control-label">{:L('PRICE_FILTER_MID')}</label>
								<div class="controls">
									<input type="text" name="price_mid" value="" placeholder="请填写价格区间如：361-760">
									<span>每组价格请用 | 隔开</span>
								</div>
							</div>
							<div class="control-group extraForm" {$display}>
								<label class="control-label">{:L('PRICE_FILTER_HIGH')}</label>
								<div class="controls">
									<input type="text" name="price_high" value="" placeholder="请填写价格区间如：761-1360">
									<span>每组价格请用 | 隔开</span>
								</div>
							</div>
							<div class="control-group extraForm" {$display}>
								<label class="control-label">{:L('CATEGORY_KEYWORDS')}</label>
								<div class="controls">
									<textarea name="term_keywords" rows="5" cols="57"></textarea>
								（多个关键词请用空格分开）									
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('CATEGORY_DESCRIPTION')}</label>
								<div class="controls">
									<textarea name="description" rows="5" cols="57"></textarea>
								</div>
							</div>
							<div class="control-group" style="display:none">
								<label class="control-label">{:L('CATEGORY_TYPE')}</label>
								<div class="controls">
									<select name="taxonomy">
										<foreach name="taxonomys" item="vo">
								        	<option value="{$key}">{$vo}</option>
										</foreach>
									</select>
								</div>
							</div>
						</fieldset>
		          </div>
		          <div class="tab-pane" id="B">
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('SEO_TITLE')}</label>
								<div class="controls">
									<input type="text" name="seo_title" value="">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('SEO_KEYWORDS')}</label>
								<div class="controls">
									<input type="text" name="seo_keywords" value="">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('SEO_DESCRIPTION')}</label>
								<div class="controls">
									<textarea name="seo_description" rows="5" cols="57"></textarea>
								</div>
							</div>
						</fieldset>
		          </div>
		          <div class="tab-pane" id="C">
						<php>$tpl_list=sp_admin_get_tpl_file_list();</php>
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('LIST_TEMPLATE')}</label>
								<div class="controls">
									<php>
										$list_tpls=$tpl_list;
										unset($list_tpls['list']);
									</php>
				              		<select  name="list_tpl">
				              			<option value="list">list{:C("TMPL_TEMPLATE_SUFFIX")}</option>
				              			<foreach name="list_tpls" item="vo">
				              				<option value="{$vo}">{$vo}{:C("TMPL_TEMPLATE_SUFFIX")}</option>
				              			</foreach>
				              		</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('ARTICLE_TEMPLATE')}</label>
								<div class="controls">
									<php>
										$article_tpls=$tpl_list;
										unset($article_tpls['article']);
									</php>
				              		<select  name="one_tpl">
				              			<option value="article">article{:C("TMPL_TEMPLATE_SUFFIX")}</option>
				              			<foreach name="article_tpls" item="vo">
				              				<option value="{$vo}">{$vo}{:C("TMPL_TEMPLATE_SUFFIX")}</option>
				              			</foreach>
				              		</select>
								</div>
							</div>
						</fieldset>
		          </div>
		        </div>
		    </div>
		    <div class="form-actions">
		     	<button class="btn btn-primary js-ajax-submit"type="submit">{:L('ADD')}</button>
		      	<a class="btn" href="{:U('AdminEMallTerm/index')}">{:L('BACK')}</a>
		    </div>
		</form>
	</div>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
	$(function(){
		//选择添加到的类目时触发的事件
		$('select[name="parent"]').on('change',function(){
			var extraForm=$('.extraForm');
			if($(this).val()>0){
				extraForm.show();
			}else{
				extraForm.hide().find(':input,select').val('');
			}
		})
	})
</script>
</body>
</html>